home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC] / NeXTSTEP 3.3 Dev Intel.iso / NextDeveloper / Headers / mach / host_info.h < prev    next >
Text File  |  1995-02-14  |  4KB  |  144 lines

  1. /* 
  2.  * Mach Operating System
  3.  * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University
  4.  * All Rights Reserved.
  5.  * 
  6.  * Permission to use, copy, modify and distribute this software and its
  7.  * documentation is hereby granted, provided that both the copyright
  8.  * notice and this permission notice appear in all copies of the
  9.  * software, derivative works or modified versions, and any portions
  10.  * thereof, and that both notices appear in supporting documentation.
  11.  * 
  12.  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
  13.  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
  14.  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
  15.  * 
  16.  * Carnegie Mellon requests users of this software to return to
  17.  * 
  18.  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
  19.  *  School of Computer Science
  20.  *  Carnegie Mellon University
  21.  *  Pittsburgh PA 15213-3890
  22.  * 
  23.  * any improvements or extensions that they make and grant Carnegie Mellon
  24.  * the rights to redistribute these changes.
  25.  */
  26. /*
  27.  * HISTORY
  28.  * $Log:    host_info.h,v $
  29.  * Revision 2.6  93/01/14  17:41:41  danner
  30.  *     Cleanup.
  31.  *     [92/06/10            pds]
  32.  *     64bit cleanup.
  33.  *     [92/12/01            af]
  34.  * 
  35.  * Revision 2.5  92/03/10  16:26:51  jsb
  36.  *     From durriya@ri.osf.org: defined kernel_boot_info_t.
  37.  *     [92/03/07  08:16:27  jsb]
  38.  * 
  39.  * Revision 2.4  91/05/14  16:51:48  mrt
  40.  *     Correcting copyright
  41.  * 
  42.  * Revision 2.3  91/02/05  17:31:58  mrt
  43.  *     Changed to new Mach copyright
  44.  *     [91/02/01  17:17:13  mrt]
  45.  * 
  46.  * Revision 2.2  90/06/02  14:57:58  rpd
  47.  *     Added HOST_LOAD_INFO and related definitions.
  48.  *     [90/04/27            rpd]
  49.  *     Created for new host/processor technology.
  50.  *     [90/03/26  23:50:51  rpd]
  51.  * 
  52.  *     Cleanup changes.
  53.  *     [89/08/02            dlb]
  54.  *     Add sched_info flavor to return minimum times for use by
  55.  *     external schedulers.
  56.  *     [89/06/08            dlb]
  57.  *     Added kernel_version type definitions.
  58.  *     [88/12/02            dlb]
  59.  * 
  60.  * Revision 2.4  89/10/15  02:05:31  rpd
  61.  *     Minor cleanups.
  62.  * 
  63.  * Revision 2.3  89/10/11  17:32:15  dlb
  64.  *     Include mach/machine/vm_types.h instead of mach/vm_param.h
  65.  *     [89/10/11            dlb]
  66.  * 
  67.  * Revision 2.2  89/10/11  14:36:55  dlb
  68.  *     Add sched_info flavor to return minimum times for use by
  69.  *     external schedulers.
  70.  *     [89/06/08            dlb]
  71.  * 
  72.  *     Added kernel_version type definitions.
  73.  *     [88/12/02            dlb]
  74.  * 
  75.  * 30-Nov-88  David Black (dlb) at Carnegie-Mellon University
  76.  *    Created.  2 flavors so far: basic info,  slot numbers.
  77.  *
  78.  */
  79.  
  80. /*
  81.  *    File:    mach/host_info.h
  82.  *
  83.  *    Definitions for host_info call.
  84.  */
  85.  
  86. #ifndef    _MACH_HOST_INFO_H_
  87. #define    _MACH_HOST_INFO_H_
  88.  
  89. #import <mach/machine.h>
  90. #import <mach/machine/vm_types.h>
  91.  
  92. /*
  93.  *    Generic information structure to allow for expansion.
  94.  */
  95. typedef integer_t    *host_info_t;        /* varying array of int. */
  96.  
  97. #define    HOST_INFO_MAX    (1024)        /* max array size */
  98. typedef integer_t    host_info_data_t[HOST_INFO_MAX];
  99.  
  100. #define KERNEL_VERSION_MAX (512)
  101. typedef char    kernel_version_t[KERNEL_VERSION_MAX];
  102. /*
  103.  *    Currently defined information.
  104.  */
  105. #define HOST_BASIC_INFO        1    /* basic info */
  106. #define HOST_PROCESSOR_SLOTS    2    /* processor slot numbers */
  107. #define HOST_SCHED_INFO        3    /* scheduling info */
  108. #define    HOST_LOAD_INFO        4    /* avenrun/mach_factor info */
  109.  
  110. struct host_basic_info {
  111.     integer_t    max_cpus;    /* max number of cpus possible */
  112.     integer_t    avail_cpus;    /* number of cpus now available */
  113.     vm_size_t    memory_size;    /* size of memory in bytes */
  114.     cpu_type_t    cpu_type;    /* cpu type */
  115.     cpu_subtype_t    cpu_subtype;    /* cpu subtype */
  116. };
  117.  
  118. typedef    struct host_basic_info    host_basic_info_data_t;
  119. typedef struct host_basic_info    *host_basic_info_t;
  120. #define HOST_BASIC_INFO_COUNT \
  121.         (sizeof(host_basic_info_data_t)/sizeof(natural_t))
  122.  
  123. struct host_sched_info {
  124.     int        min_timeout;    /* minimum timeout in milliseconds */
  125.     int        min_quantum;    /* minimum quantum in milliseconds */
  126. };
  127.  
  128. typedef    struct host_sched_info    host_sched_info_data_t;
  129. typedef struct host_sched_info    *host_sched_info_t;
  130. #define HOST_SCHED_INFO_COUNT \
  131.         (sizeof(host_sched_info_data_t)/sizeof(int))
  132.  
  133. struct host_load_info {
  134.     integer_t    avenrun[3];    /* scaled by LOAD_SCALE */
  135.     integer_t    mach_factor[3];    /* scaled by LOAD_SCALE */
  136. };
  137.  
  138. typedef struct host_load_info    host_load_info_data_t;
  139. typedef struct host_load_info    *host_load_info_t;
  140. #define    HOST_LOAD_INFO_COUNT \
  141.         (sizeof(host_load_info_data_t)/sizeof(natural_t))
  142.  
  143. #endif    /* _MACH_HOST_INFO_H_ */
  144.